package db.standard;

import db.CommonObject;
import db.nutriment.Nutriment;
import db.standard.classification.Classification;
import formulation.UnitConvertor;

public class Standard extends CommonObject
{
    private Classification classification;
    private Nutriment nutriment;
    private Double max;
    private Double min;
    
    public Standard() {
        super.setType("Standard");
    }
    
    public Classification getClassification() {
        return classification;
    }
    
    public void setClassification(Classification classification) {
        this.classification = classification;
    }
    
    public Nutriment getNutriment() {
        return nutriment;
    }
    
    public void setNutriment(Nutriment nutriment) {
        this.nutriment = nutriment;
    }
    
    public Double getMax() {
        return max;
    }
    
    public Double getMaxInUnit() {
        return UnitConvertor.changeFromBaseUnit(nutriment.getUnit(), max);
    }
    
    public void setMax(Double max) {
        this.max = max;
    }
    
    public void setMaxInUnit(Double max) {
        this.max = UnitConvertor.changeToBaseUnit(nutriment.getUnit(), max);
    }
    
    public Double getMin() {
        return min;
    }
    
    public Double getMinInUnit() {
        return UnitConvertor.changeFromBaseUnit(nutriment.getUnit(), min);
    }
    
    public void setMin(Double min) {
        this.min = min;
    }
    
    public void setMinInUnit(Double min) {
        this.min = UnitConvertor.changeToBaseUnit(nutriment.getUnit(), min);
    }
}
